# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: François Charette <francois ατ archlinux δοτ org>
# Contributor: Jason Chu <jchu@xentac.net>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>

pkgname=perl-tk
pkgver=804.034
pkgrel=2
pkgdesc="A graphical user interface toolkit for Perl"
arch=('x86_64')
url="http://search.cpan.org/dist/Tk"
license=('PerlArtistic' 'GPL' 'custom')
depends=('libpng' 'libjpeg' 'tk' 'perl')
checkdepends=('xorg-server-xvfb' 'perl-devel-leak' 'perl-test-pod' 'ttf-font')
options=('!emptydirs' '!strip')
source=(http://www.cpan.org/authors/id/S/SR/SREZIC/Tk-${pkgver}.tar.gz)
sha512sums=('8d04fd902db72f80f749256453703e40c94fd009c6a196c608dd3bde4eeb99f974a154d5f52b28baa9e67f75529f0180619989c16cae28a9417b647908de04b6')

build() {
  cd Tk-$pkgver

  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd Tk-$pkgver
  xvfb-run make -j1 test
}

package() {
  cd Tk-$pkgver
  make install DESTDIR="$pkgdir"

  # license
  install -D -m644 pTk/license.terms \
                   "${pkgdir}/usr/share/licenses/${pkgname}/tk.license"
  install -D -m644 pTk/Tix.license \
                   "${pkgdir}/usr/share/licenses/${pkgname}/tix.license"
}
